 import React, {Component} from 'react';
 import {Platform, StyleSheet ,View,Text} from 'react-native';

 export default class HomePage extends Component {

   constructor(props) {
     
    super(props);
    this.state = {isShowText:false};
    this._timer = null;
    
  }


  componentWillMount(){

    this._timer = setInterval(() => {

      console.log("setInterval: "+this.state.isShowText)
      this.setState(previousState => {
        return { isShowText: !previousState.isShowText };
      });
      
    }, 1000);

  }

  componentWillUnmount(){
    this._timer && clearInterval(this._timer);
  }
  
  render() {

    if(!this.state.isShowText){
      return null;
    }

    return (
      <View style={{ flex: 1, alignItems: 'center', justifyContent: 'center' }}>
        <Text>Home Screen 1</Text>
        <Text>Home Screen 2</Text>
        <Text>Home Screen 3</Text>
        <Text>Home Screen 4</Text>
        <Text>Home Screen 5</Text>
      </View>
      );
  }  
}
  